<script>
export default {
  name: "customDirectives",
  data(){
    return{
      red:'red',
      yel:'yellow',
      val:''
    }
  },
  method:{},
  directives:{
    //相当于bind写法
    'own-fsize20'(el,binding){
      console.log(el,'这是私有定义');
      console.log(binding,'私有定义的banning')
    },
    //第二种写法
    // 'own-fsize40':{
    //   bind(el,binding){},
    //   inserted(el){},
    //   update(el){},
  }

}
</script>

<template>
<div>
  自定义指令
  <div v-color="red">文本颜色</div>
  <div v-color="yel">文本颜色</div>
  <input type="text" v-model="val" v-color="yel">
  <div v-own-fsize20>这是文本</div>
  <input type="text" v-model="val" v-own-fsize20>
</div>
</template>

<style scoped lang="less">

</style>